#include <repository/member/points_reward_item_repository.h>

using namespace model;

// CRUD Operations
insert_ret_type PointsRewardItemRepository::create(
  const PointsRewardItemDTO& points_reward_item_dto)
{
  return _insert(points_reward_item_dto);
};

select_ret_type<PointsRewardItemDTO>
PointsRewardItemRepository::getByItemName(const std::string& item_name)
{
  return _select(db::points_reward_item{}.item_name == item_name);
};

update_ret_type
PointsRewardItemRepository::updateById(const in_id_type id,
                                       const PointsRewardItemDTO& dto)
{
  return _update(dto, db::points_reward_item{}.id == id);
};

delete_ret_type PointsRewardItemRepository::removeById(const in_id_type id)
{
  return _remove(db::points_reward_item{}.id == id);
}

// Custom Queries
select_ret_type<PointsRewardItemDTO> PointsRewardItemRepository::getAll()
{
  return _select(db::points_reward_item{}.id >= 0);
}

select_ret_type<PointsRewardItemDTO>
PointsRewardItemRepository::getByPage(int page_size, int offset)
{
  return _select_from(db::points_reward_item{}.id >= 0, page_size, offset);
}

count_type PointsRewardItemRepository::count()
{
  return _count();
}

// 其他方法实现...
